home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / diskct13.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1996-06-03  |  3KB  |  107 lines

  1. /* install DiskCat */
  2.  
  3. call RxFuncAdd "SysLoadFuncs","RexxUtil","SysLoadFuncs"
  4. call SysLoadFuncs
  5. call SysCls
  6.  
  7. say
  8. say   "DiskCat install utility"
  9. say
  10. say
  11. say   "please enter target drive/path :"
  12. say   "(default C:\DiskCat)"
  13. pos = SysCurPos(4,34)
  14. pull  drive
  15. pos = SysCurPos(7,0)
  16.  
  17. map = SysDriveMap("A:")
  18. targetdrive = "C:\DiskCat\"
  19. dp = ":"
  20. bs = "\"
  21.  
  22. if substr(drive,1,1) = ""
  23.    then  target = targetdrive
  24.    else  target = drive
  25. if substr(target,2,1) = ""
  26.    then  target = insert(dp,target,1)
  27. if substr(target,3,1) = ""
  28.    then  target = insert(bs,target,2)
  29.  
  30. if wordpos(substr(target,1,2),map) = 0
  31.    then  do
  32.       say   "drive does not exist!"
  33.       exit
  34.    end
  35.  
  36. if substr(target,length(target),1) = bs
  37.    then  target = delstr(target,length(target),1)
  38.  
  39. if length(target) > 3 then do
  40.  
  41.    rc = SysFileTree(target,"result","D")
  42.    dirfound = 0
  43.  
  44.    if result.0 = 0 then do
  45.  
  46.       say "directory does not exist, create ? y/n :"
  47.       pos = SysCurPos(7,45)
  48.       pull answer
  49.  
  50.       if answer = "Y" then do
  51.          rc = SysMkDir(target)
  52.  
  53.          if rc > 0 then do
  54.             say "could not create target directory !!!"
  55.             exit
  56.          end
  57.          else do
  58.             rc = SysFileTree(target,"result","D")
  59.             if result.0 > 0 then
  60.                dirfound = 1
  61.          end
  62.       end
  63.    end
  64.    else
  65.       dirfound = 1
  66. end
  67.  
  68.  
  69. if dirfound = 1 then do
  70.    "@copy diskcat.exe  >NUL" target
  71.    "@copy diskcat.inf  >NUL" target
  72.    "@copy diskcat.ico  >NUL" target
  73.    "@copy diskcat.msg  >NUL" target
  74.    "@copy lcd.fon      >NUL" target
  75.    "@copy file_id.diz  >NUL" target
  76.    "@copy bmtmicro.reg >NUL" target
  77.  
  78.    rc = SysCreateObject("WPFolder", ,
  79.                         "Disk Catalog", ,
  80.                         "<WP_DESKTOP>", ,
  81.                         "OBJECTID=<DSK_CAT>")
  82.  
  83.    rc = SysSetObjectData('<DSK_CAT>', 'ICONFILE='||target||'\diskcat.ico;')
  84.    rc = SysSetObjectData('<DSK_CAT>', 'OPEN=DEFAULT;')
  85.    rc = SysFileDelete(target||'\diskcat.ico')
  86.  
  87.    options = "EXENAME=" || target || "\DiskCat.EXE;" || "STARTUPDIR=" || target || ";"
  88.    rc = SysCreateObject('WPProgram','Disk Catalog','<DSK_CAT>',options,'REPLACE');
  89.  
  90.    options = "EXENAME=VIEW.EXE;PARAMETERS=" || target || "\diskcat.inf;"
  91.    rc = SysCreateObject('WPProgram','Handbook','<DSK_CAT>',options,'REPLACE');
  92.  
  93.    options = "SHADOWID=" || target || "\bmtmicro.reg;OBJECTID=<DSK_CAT_REG>"
  94.    rc = SysCreateObject('WPShadow','Registration^Form','<DSK_CAT>',options,'REPLACE');
  95.  
  96.    drive = substr(target,1,2)
  97.    drive
  98.    "@cd "target
  99.  
  100.    "start diskcat.exe "
  101. end
  102.  
  103.  
  104. call SysDropFuncs
  105. exit
  106.  
  107.